<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="#{webContext.skin0Culomns}"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">


    <ui:define name="center">
        <h:form id="mulaForm">
            <p:growl globalOnly="true" id="messages" showDetail="true"/>
            <p:breadCrumb>  
                <p:menuitem value="#{ml.tr('Home')}" url="#{webContext.baseUrl}" />  
                <p:menuitem value="#{ml.tr('mula_managerLanguages')}" url="#" />
            </p:breadCrumb>
            <ui:include src="#{webContext.skinPatch}statusDialog.xhtml" />
            <p:toolbar>
                <p:toolbarGroup align="left">
                    <p:commandButton 
                        actionListener="#{mulaList.save}"
                        update="messages"
                        image="ui-icon ui-icon-disk"
                        onclick="statusDialog.show()"
                        oncomplete="statusDialog.hide()"
                        value="#{ml.tr('Save')}"/>
                    <p:divider />

                    <h:commandButton value="#{ml.tr('Export to file')}">
                        <p:fileDownload value="#{mulaList.file}" />
                    </h:commandButton>

                </p:toolbarGroup>
            </p:toolbar>

            <p:dataTable id="dataTable" 
                         var="mulaTranslate" 
                         value="#{mulaList.mulaTranslates}"
                         paginator="true" 
                         rows="12">

                <p:column filterBy="#{mulaTranslate.mulaTranslatePK.key}"
                          headerText="#{ml.tr('Key')}"
                          filterMatchMode="contains">   
                    <h:outputText value="#{mulaTranslate.mulaTranslatePK.key}" />
                </p:column>  

                <p:column filterBy="#{mulaTranslate.mulaTranslatePK.isoLanguage}"
                          filterOptions="#{mulaList.isoLanguageOption}"
                          filterMatchMode="exact"
                          style="width: 30px;">  
                    <f:facet name="header">
                        #{ml.tr("Language")}
                    </f:facet>  
                    <h:outputText value="#{mulaTranslate.mulaTranslatePK.isoLanguage}" />  
                </p:column>

                <p:column sortBy="#{mulaTranslate.translate}"
                          filterBy="#{mulaTranslate.translate}"
                          filterMatchMode="contains"
                          headerText="#{ml.tr('Translate')}">   
                    <h:inputText value="#{mulaTranslate.translate}" 
                                 style="width: 100%"/>
                </p:column>

                <p:column style="width: 20px">
                    <p:commandButton action="#{mulaList.delete(mulaTranslate)}" 
                                     image="ui-icon ui-icon-closethick"
                                     title="#{ml.tr('Delete')}"
                                     update="mulaForm" />
                </p:column>
            </p:dataTable>
            <p:commandLink
                value="#{ml.tr('Export to XLS')}" >
                <p:dataExporter type="xls" target="dataTable" fileName="cars" />
            </p:commandLink>
        </h:form>
    </ui:define>

</ui:composition>
